



import requests
import base64
#加密
secret_msg = base64.b64encode("霍格沃兹".encode('utf-8'))
def send():
    url = "https://httpbin.ceshiren.com/post"
    data = {"msg":secret_msg}
    res = requests.post(url,data=data)
    #获取加密响应数据
    print(res.json())
    msg=res.json()["form"]["msg"]
    #对获取的加密数据进行解密
    encoded_str=base64.b64decode(msg).decode('utf-8')
    print(encoded_str)
    assert encoded_str == "霍格沃兹"
send()

